package com.yun.platform.iot.controller;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yun.platform.config.ListController;
import com.yun.platform.config.dto.RData;
import com.yun.platform.iot.dto.ProjectDto;
import com.yun.platform.iot.entity.Project;
import com.yun.platform.iot.service.ProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Hanson  2022-11-24
 *
 * @Desciprtion:  项目表相关接口
 */
@RestController
@RequestMapping("/iot/project")
@Slf4j
@Api(value = "项目表相关接口", tags = {"项目表操作接口"})
public class ProjectController extends ListController<ProjectDto, Project> {

    @Autowired
    private ProjectService projectService;

    @Override
    public ServiceImpl getService() {
        return projectService;
    }

    @ApiOperation("项目查询楼层区域")
    @PostMapping("/listProFloorArea")
    public RData listProFloorArea(@RequestParam Integer proId, Integer floorId){
        return RData.success(projectService.listProFloorArea(proId, floorId));
    }

    @ApiOperation("ts项目查询楼层区域")
    @PostMapping("/listProFloorAreats")
    public RData listProFloorAreats(@RequestParam Integer proId, Integer floorId){
        return RData.success(projectService.listProFloorAreats(proId, floorId));
    }
    
}